﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.SessionState;
using ControllerExtensibility.Models;

namespace ControllerExtensibility.Controllers
{
    [SessionState(SessionStateBehavior.Disabled)]//sin sesion
    public class FastController : Controller
    {
        public ActionResult Index()
        {
            Session["Message"] = "Hello"; //throws exception
            /*If you are simply trying to pass data from the controller to the view, consider using the View Bag feature
             * instead, which is not affected by the SessionState attribute.*/
            return View("Result", new Result
            {
                ControllerName = "Fast ",
                ActionName = "Index"
            });
        }
    }
}
